#include "Heap.h"



void HeapSort(int* a, int n)
{
	
	for (int i = (n - 2) / 2; i >= 0; --i)
	{
		AdjustDown(a, n,i);
	}
	int end = n-1 ;
	while (end > 0) 
	{
		Swap(&a[0], &a[end]);
		AdjustDown(a, end, 0);
		--end;
	}
}

int main()
{
	int a[] = { 27,15,29,18,28,34,65,49,25,37 };
	int n = sizeof(a) / sizeof(a[0]);
	HeapSort(a,n);
	
	Heap hp;
	HeapInit(&hp, a, n);
	
	return 0;
}
